import {
	myRequest
} from '@/utils/request.js'
/**
 * 分页列表
 */
export const getPage = (obj) => {
	return myRequest({
		url: '/mallapi/useraddress/page',
		method: 'get',
		data: obj,
		showLoading: true
	});
}

export const delObj = (id) => {
	return myRequest({
		url: '/mallapi/useraddress/' + id,
		method: 'delete',
		showLoading: true
	});
}

/**
 * 新增/编辑用户收货地址
 */
export const saveOrUpdateAddress = (data) => {
	return myRequest({
		url: '/mallapi/useraddress',
		method: 'post',
		data,
		showLoading: true
	});
}

/**
 获取默认地址
 */
export const defaultAddress = () => {
	return myRequest({
		url: '/mallapi/useraddress/default/address',
		method: 'get',
		showLoading: false
	});
}
